<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Run configured diagnostics on parsed and repaired markup</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.construct.html">tidy::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.props.errorbuffer.html">tidy::$errorBuffer</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="tidy.diagnose" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">tidy::diagnose</h1>
  <h1 class="refname">tidy_diagnose</h1>
  <p class="verinfo">(PHP 5, PECL tidy &gt;= 0.5.2)</p><p class="refpurpose"><span class="refname">tidy::diagnose</span> -- <span class="refname">tidy_diagnose</span> &mdash; <span class="dc-title">Run configured diagnostics on parsed and repaired markup</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-tidy.diagnose-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>tidy::diagnose</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>tidy_diagnose</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.tidy.html" class="type tidy">tidy</a></span> <code class="parameter">$object</code></span>
   )</div>

  <p class="para rdfs-comment">
   Runs diagnostic tests on the given tidy <em><code class="parameter">object</code></em>,
   adding some more information about the document in the error buffer.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-tidy.diagnose-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">object</code></em></dt>

     <dd>

      <p class="para">
       The <a href="class.tidy.html" class="classname">Tidy</a> 对象。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-tidy.diagnose-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-tidy.diagnose-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3952">
    <p><strong>Example #1 <span class="function"><strong>tidy::diagnose()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$html&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;&nbsp;HTML<br /></span><span style="color: #DD0000">&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN"<br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br /><br />&lt;p&gt;paragraph&lt;/p&gt;<br /></span><span style="color: #007700">HTML;<br /><br /></span><span style="color: #0000BB">$tidy&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">tidy_parse_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cleanRepair</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">//&nbsp;note&nbsp;the&nbsp;difference&nbsp;between&nbsp;the&nbsp;two&nbsp;outputs<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errorBuffer&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">diagnose</span><span style="color: #007700">();<br />echo&nbsp;</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">errorBuffer</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
line 4 column 1 - Warning: &lt;p&gt; isn&#039;t allowed in &lt;head&gt; elements
line 4 column 1 - Warning: inserting missing &#039;title&#039; element
line 4 column 1 - Warning: &lt;p&gt; isn&#039;t allowed in &lt;head&gt; elements
line 4 column 1 - Warning: inserting missing &#039;title&#039; element
Info: Doctype given is &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
Info: Document content looks like XHTML 1.0 Strict
2 warnings, 0 errors were found!
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-tidy.diagnose-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><strong>tidy::errorBuffer()</strong></span></li>
  </ul>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="tidy.construct.html">tidy::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="tidy.props.errorbuffer.html">tidy::$errorBuffer</a></div>
 <div class="up"><a href="class.tidy.html">tidy</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
